package game;

import java.awt.*;

/**
 * 描述：爆炸类
 * 可以显示爆炸效果
 * @author wangb
 * @version 1.0
 * create 2018-11-02-0:05
 */
public class Explode{
    double x,y;
    static Image[] imgs = new Image[16];

    static {
        for ( int i = 0 ; i <imgs.length  ; i++ ) {
            imgs[i] = GameUtil.getImage ("images/explode/e"+(i+1)+".gif");
            imgs[i].getWidth (null);
        }
    }
    int count ;

    public Explode(double x , double y) {
        this.x = x;
        this.y = y;
    }

    public void draw(Graphics g){
        if(count <= 15){

            g.drawImage (imgs[count],(int) x,(int) y,null);
        }
        count++;
    }


}
